package br.unifor.cct.mia.pso;


public class PSOSomatorio extends PSO {

	private double minVal = 0;
	private double maxVal = 10;
	
	private static String[] configuracoes = {
		"br.unifor.cct.mia.initialize.PSOBasicRandonInitialize",
		"br.unifor.cct.mia.velocity.PSOBasicVelocity",
		"br.unifor.cct.mia.evaluate.pso.PSOSomatorioEvaluate"
	};	
	
	public static void main(String arg[]) {
		PSO pso = new PSOSomatorio(10,new String[0]);
		pso.setPopSize(5);
		pso.setExecSize(5);
		new Thread(pso).start();
	}
	
	public PSOSomatorio(int nVar, String[] options) {
    	super(nVar, configuracoes, options);
	}

	@Override
	public Object[] getObjectsEvaluate() {
		Object[] o =  new Object[1];
		o[0] = this;
		return o;
	}

	@Override
	public Object[] getObjectsInitialize() {
		Object[] o =  new Object[4];
		o[0] = this.getConfigurations();
		o[1] = this.getPopulacao();
		o[2] = new Double(this.minVal);
		o[3] = new Double(this.maxVal);
		return o;
	}

	@Override
	public Object[] getObjectsVelocity() {
		Object[] o =  new Object[1];
		o[0] = this;
		return o;
	}
	
	@Override
	public void graphic() {
		graphic.addPointLinha(0, geracao, getBestIndividual().getFitness());    	
	}
	
	public double getMaxVal() {
		return maxVal;
	}
	public void setMaxVal(double maxVal) {
		this.maxVal = maxVal;
	}

}
